home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-03 | 2.1 KB | 84 lines | [TEXT/GEOL] |
- Item forwarded by SHAYER1 to D0377
-
- Item forwarded by A33 to A34
-
- Item 4551074 1-Nov-89 14:09
-
- From: KNEPPER Knepper, Christopher
-
- To: NORVELL.J Norvell, Joel
-
- cc: MACAPP.TECH$ MacApp Technical
- FIFTHGENSYS Fifth Generation Sys, S Nauman,PRT
- DISHON.D Dishon, Danny
- SHAYER1 Shayer, David
-
- Sub: Re: A bug with Suitcase.
-
- Joel,
-
- I had a similar problem when creating a popup menu of DAs with Suitcase II.
- Here's my solution to give you an alternative to the solution proposed by Steve
- Brecher. My solution works for a popup menu of installed DAs and I've tested it
- with/without Suitcase II. {Note that handling DAs and Fonts from TPopUp is
- essentially the same problem.}
-
- The main advantage to my solution over Steve's is that it avoids altering
- MacApp source code and works with MacApp 2.0ß9 "as is".
-
- First, create a dummy 'MENU' in your app's ".r" file:
-
- resource 'MENU' (302) {
- 302,
- textMenuProc,
- allEnabled,
- enabled,
- "DAs:",
- {}
- };
-
- Then, (I assume you're using template views rather than procedural views)
- specify kNoResource as the rsrc ID in the view resource for the popup:
-
- root, 'DAs!',
- { 80, 4 },
- { 19, 168 }, sizeFixed, sizeFixed, shown, enabled,
- Popup {
- "TDAPopup",
- 0b0,
- {2, 2},
- notSizeable,
- notDimmed,
- notHilited,
- doesntDismiss,
- noInset,
- systemFont,
- kNoResource,
- 1,
- 30
- },
-
- Finally, the only method that you need to write is TDAPopUp.IRes,:
-
- PROCEDURE TDAPopup.IRes(itsDocument: TDocument; itsSuperView: TView;
- VAR itsParams: Ptr); OVERRIDE;
- VAR
- rsrcID : INTEGER;
- aMenu : MenuHandle;
- BEGIN
- INHERITED IRes(itsDocument, itsSuperView, itsParams);
- fRsrcID := 302;
- aMenu := GetMenu(302);
- { Don't die because resource not found - just return NIL handle }
- FailResError;
- IF aMenu <> NIL THEN
- BEGIN
- HNoPurge(Handle(aMenu));
- InsertResMenu(aMenu,'DRVR',0); { add DA names to menu }
- END;
- SetPopup(aMenu, 302, 1, False);
- END;
-
- -Chris
-
-